<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Return first attribute</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="function.ldap-explode-dn.html">« ldap_explode_dn</a></li>
      <li style="float: right;"><a href="function.ldap-first-entry.html">ldap_first_entry »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="ref.ldap.html">LDAP 函数</a></li>
    <li>Return first attribute</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="function.ldap-first-attribute" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ldap_first_attribute</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">ldap_first_attribute</span> &mdash; <span class="dc-title">Return first attribute</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.ldap-first-attribute-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>ldap_first_attribute</strong></span>(<span class="methodparam"><span class="type"><a href="class.ldap-connection.html" class="type LDAP\Connection">LDAP\Connection</a></span> <code class="parameter">$ldap</code></span>, <span class="methodparam"><span class="type"><span class="type LDAP\ResultEntry">LDAP\ResultEntry</span></span> <code class="parameter">$entry</code></span>): <span class="type"><span class="type">string</span>|<span class="type"><span class="type false">false</span></span></span></div>

  <p class="para rdfs-comment">
   Gets the first attribute in the given entry. Remaining attributes are
   retrieved by calling <span class="function"><a href="function.ldap-next-attribute.html" class="function">ldap_next_attribute()</a></span> successively.
  </p>
  <p class="para">
   Similar to reading entries, attributes are also read one by one from a
   particular entry.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.ldap-first-attribute-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    
     <dt>
<code class="parameter">ldap</code></dt>

     <dd>

      <p class="para">
       通过 <span class="function"><a href="function.ldap-connect.html" class="function">ldap_connect()</a></span> 返回的 <span class="classname"><a href="class.ldap-connection.html" class="classname">LDAP\Connection</a></span> 实例。
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">entry</code></dt>

     <dd>

      <p class="para">
       <span class="classname"><a href="class.ldap-result-entry.html" class="classname">LDAP\ResultEntry</a></span> 实例。
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">ber_identifier</code></dt>

     <dd>

      <p class="para">
       <code class="parameter">ber_identifier</code> is the identifier to internal
       memory location pointer. It is passed by reference. The same
       <code class="parameter">ber_identifier</code> is passed to
       <span class="function"><a href="function.ldap-next-attribute.html" class="function">ldap_next_attribute()</a></span> , which modifies that
       pointer.
      </p>
      <blockquote class="note"><p><strong class="note">注意</strong>: 
       <p class="para">
        This parameter is no longer used as this is now handled automatically
        by PHP. For backwards compatibility PHP will not throw an error if
        this parameter is passed.
       </p>
      </p></blockquote>
     </dd>

    
   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.ldap-first-attribute-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns the first attribute in the entry on success and <strong><code>false</code></strong> on
   error.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.ldap-first-attribute-changelog">
  <h3 class="title">更新日志</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>版本</th>
      <th>说明</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
 <td>8.1.0</td>
 <td>
  现在 <code class="parameter">ldap</code> 参数接受 <span class="classname"><a href="class.ldap-connection.html" class="classname">LDAP\Connection</a></span>
  实例，之前接受 <a href="language.types.resource.html" class="link">资源(resource)</a>。
 </td>
</tr>

     <tr>
 <td>8.1.0</td>
 <td>
  The <code class="parameter">entry</code> parameter expects an <span class="classname"><a href="class.ldap-result-entry.html" class="classname">LDAP\ResultEntry</a></span>
  instance now; previously, a <a href="language.types.resource.html" class="link">资源(resource)</a> was expected.
 </td>
</tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 seealso" id="refsect1-function.ldap-first-attribute-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><span class="function"><a href="function.ldap-next-attribute.html" class="function" rel="rdfs-seeAlso">ldap_next_attribute()</a> - Get the next attribute in result</span></li>
    <li class="member"><span class="function"><a href="function.ldap-get-attributes.html" class="function" rel="rdfs-seeAlso">ldap_get_attributes()</a> - Get attributes from a search result entry</span></li>
   </ul>
  </p>
 </div>


</div></div></div></body></html>